<head>
  <meta name="layout" content="main"/>
  <title>User Registration</title>
</head>

<body>

<div class="nav">
  <span class="menuButton"><a class='home' href="%{--
  - Copyright 2010 Nicolas Martignole.
  - Licensed under the Apache License, Version 2.0 (the "License");
  - you may not use this file except in compliance with the License.
  - You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless
  - required by applicable law or agreed to in writing, software distributed under
  - the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
  - OR CONDITIONS OF ANY KIND, either express or implied.
  - See the License for the specific language governing permissions
  - and limitations under the License.
  --}%

${createLinkTo(dir: '')}">Home</a></span>
</div>

<div class="body">
  <h1>User Registration</h1>
  <g:if test="${flash.message}">
    <div class="message">${flash.message}</div>
  </g:if>
  <g:hasErrors bean="${person}">
    <div class="errors">
      <g:renderErrors bean="${person}" as="list"/>
    </div>
  </g:hasErrors>

  <g:form action="save">
    <div class="dialog">
      <table>
        <tbody>

        <tr class='prop'>
          <td valign='top' class='name'><label for='username'>Login Name:</label></td>
          <td valign='top' class='value ${hasErrors(bean: person, field: 'username', 'errors')}'>
            <input type="text" name='username' value="${person?.username?.encodeAsHTML()}"/>
          </td>
        </tr>

        <tr class="prop">
          <td valign="top" class="name">
            <label for="civility"><g:message code="account.civility.label" default="Civility"/></label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: person, field: 'civility', 'errors')}">
            <g:select name="civility" from="${org.letouilleur.celerio.CivilityEnum?.values()}" value="${person?.civility}"  />

          </td>
        </tr>
        <tr class='prop'>
          <td valign='top' class='name'><label for='firstName'>First Name:</label></td>
          <td valign='top' class='value ${hasErrors(bean: person, field: 'firstName', 'errors')}'>
            <input type="text" name='firstName' value="${person?.firstName?.encodeAsHTML()}"/>
          </td>
        </tr>


        <tr class='prop'>
          <td valign='top' class='name'><label for='lastName'>Last Name:</label></td>
          <td valign='top' class='value ${hasErrors(bean: person, field: 'lastName', 'errors')}'>
            <input type="text" name='lastName' value="${person?.lastName?.encodeAsHTML()}"/>
          </td>
        </tr>

        <tr class='prop'>
          <td valign='top' class='name'><label for='password'>Password:</label></td>
          <td valign='top' class='value ${hasErrors(bean: person, field: 'password', 'errors')}'>
            <input type="password" name='password' value="${person?.password?.encodeAsHTML()}"/>
          </td>
        </tr>

        <tr class='prop'>
          <td valign='top' class='name'><label for='repasswd'>Confirm Password:</label></td>
          <td valign='top' class='value ${hasErrors(bean: person, field: 'password', 'errors')}'>
            <input type="password" name='repasswd' value="${person?.password?.encodeAsHTML()}"/>
          </td>
        </tr>

        <tr class='prop'>
          <td valign='top' class='name'><label for='email'>Email:</label></td>
          <td valign='top' class='value ${hasErrors(bean: person, field: 'email', 'errors')}'>
            <input type="text" name='email' value="${person?.email?.encodeAsHTML()}"/>
          </td>
        </tr>

        <tr class='prop'>
          <td valign='bottom' class='name'><label for='code'>Enter Code:</label></td>
          <td valign='top' class='name'>
            <input type="text" name="captcha" size="8"/>
            <img src="${createLink(controller: 'captcha', action: 'index')}" align="absmiddle"/>
          </td>
        </tr>

        </tbody>
      </table>
    </div>

    <div class="buttons">
      <span class="formButton">
        <input class='save' type="submit" value="Create"></input>
      </span>
    </div>

  </g:form>
</div>
</body>
